package fractal

import util._

class Julia(val c: Complex) extends EscapeTimeFractal
{
	override val name = "Julia"
	override val params = List("c = " + c)
	override val axes = (-2.0, 2.0, -2.0, 2.0)
	override val limit = 5.0
	override val numIters = 100

 	override def getBW(c: Complex): Int = 
	{
		var z = c
		for (i <- 0 until numIters)
		{
			z = z*z + this.c;
			if (z.mag > limit) return 0xFFFFFF
		}
		0x000000
	}
 
	override def getColor(c: Complex): Int = 
	{
		var z = c
		for (i <- 0 until numIters)
		{
			z = z*z + this.c;
			if (z.mag > limit)
				return COLORS(i*COLORS.length/numIters)
		}
		0x000000
	}
}
